.class public Lcom/melesta/payment/amazon/PurchasingObserver;
.super Lcom/amazon/inapp/purchasing/BasePurchasingObserver;
.source "PurchasingObserver.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/melesta/payment/amazon/PurchasingObserver$3;
    }
.end annotation


# static fields
.field private static final OFFSET:Ljava/lang/String; = "offset"

.field private static final TAG:Ljava/lang/String; = "Amazon-IAP"


# instance fields
.field private final mContext:Landroid/content/Context;

.field private final mPaymentSystem:Lcom/melesta/payment/amazon/PaymentSystem;

.field private mUserId:Ljava/lang/String;


# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/melesta/payment/amazon/PaymentSystem;)V
    .locals 0
    .parameter "arg0"
    .parameter "paymentSystem"

    .prologue
    .line 43
    invoke-direct {p0, p1}, Lcom/amazon/inapp/purchasing/BasePurchasingObserver;-><init>(Landroid/content/Context;)V

    .line 44
    iput-object p1, p0, Lcom/melesta/payment/amazon/PurchasingObserver;->mContext:Landroid/content/Context;

    .line 45
    iput-object p2, p0, Lcom/melesta/payment/amazon/PurchasingObserver;->mPaymentSystem:Lcom/melesta/payment/amazon/PaymentSystem;

    .line 46
    return-void
.end method

.method static synthetic access$000(Lcom/melesta/payment/amazon/PurchasingObserver;)Lcom/melesta/payment/amazon/PaymentSystem;
    .locals 1
    .parameter "x0"

    .prologue
    .line 35
    iget-object v0, p0, Lcom/melesta/payment/amazon/PurchasingObserver;->mPaymentSystem:Lcom/melesta/payment/amazon/PaymentSystem;

    return-object v0
.end method

.method private getSharedPreferencesEditor()Landroid/content/SharedPreferences$Editor;
    .locals 1

    .prologue
    .line 391
    invoke-direct {p0}, Lcom/melesta/payment/amazon/PurchasingObserver;->getSharedPreferencesForCurrentUser()Landroid/content/SharedPreferences;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    return-object v0
.end method

.method private getSharedPreferencesForCurrentUser()Landroid/content/SharedPreferences;
    .locals 4

    .prologue
    .line 386
    iget-object v1, p0, Lcom/melesta/payment/amazon/PurchasingObserver;->mContext:Landroid/content/Context;

    iget-object v2, p0, Lcom/melesta/payment/amazon/PurchasingObserver;->mUserId:Ljava/lang/String;

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    .line 387
    .local v0, settings:Landroid/content/SharedPreferences;
    return-object v0
.end method


# virtual methods
.method public onGetUserIdResponse(Lcom/amazon/inapp/purchasing/GetUserIdResponse;)V
    .locals 7
    .parameter "getUserIdResponse"

    .prologue
    .line 71
    const-string v4, "Amazon-IAP"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "onGetUserIdResponse recieved: Response -"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 72
    const-string v4, "Amazon-IAP"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "RequestId:"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {p1}, Lcom/amazon/inapp/purchasing/GetUserIdResponse;->getRequestId()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 73
    const-string v4, "Amazon-IAP"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "IdRequestStatus:"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {p1}, Lcom/amazon/inapp/purchasing/GetUserIdResponse;->getUserIdRequestStatus()Lcom/amazon/inapp/purchasing/GetUserIdResponse$GetUserIdRequestStatus;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 75
    invoke-virtual {p1}, Lcom/amazon/inapp/purchasing/GetUserIdResponse;->getUserIdRequestStatus()Lcom/amazon/inapp/purchasing/GetUserIdResponse$GetUserIdRequestStatus;

    move-result-object v4

    sget-object v5, Lcom/amazon/inapp/purchasing/GetUserIdResponse$GetUserIdRequestStatus;->SUCCESSFUL:Lcom/amazon/inapp/purchasing/GetUserIdResponse$GetUserIdRequestStatus;

    if-ne v4, v5, :cond_0

    .line 76
    invoke-virtual {p1}, Lcom/amazon/inapp/purchasing/GetUserIdResponse;->getUserId()Ljava/lang/String;

    move-result-object v4

    iput-object v4, p0, Lcom/melesta/payment/amazon/PurchasingObserver;->mUserId:Ljava/lang/String;

    .line 79
    iget-object v4, p0, Lcom/melesta/payment/amazon/PurchasingObserver;->mContext:Landroid/content/Context;

    invoke-virtual {v4}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    .line 80
    .local v0, applicationContext:Landroid/content/Context;
    iget-object v4, p0, Lcom/melesta/payment/amazon/PurchasingObserver;->mUserId:Ljava/lang/String;

    const/4 v5, 0x0

    invoke-virtual {v0, v4, v5}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v3

    .line 81
    .local v3, sharedPreferences:Landroid/content/SharedPreferences;
    const-string v4, "offset"

    sget-object v5, Lcom/amazon/inapp/purchasing/Offset;->BEGINNING:Lcom/amazon/inapp/purchasing/Offset;

    invoke-virtual {v5}, Lcom/amazon/inapp/purchasing/Offset;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-interface {v3, v4, v5}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 82
    .local v2, offsetStr:Ljava/lang/String;
    invoke-static {v2}, Lcom/amazon/inapp/purchasing/Offset;->fromString(Ljava/lang/String;)Lcom/amazon/inapp/purchasing/Offset;

    move-result-object v1

    .line 83
    .local v1, offset:Lcom/amazon/inapp/purchasing/Offset;
    invoke-static {v1}, Lcom/amazon/inapp/purchasing/PurchasingManager;->initiatePurchaseUpdatesRequest(Lcom/amazon/inapp/purchasing/Offset;)Ljava/lang/String;

    .line 88
    .end local v0           #applicationContext:Landroid/content/Context;
    .end local v1           #offset:Lcom/amazon/inapp/purchasing/Offset;
    .end local v2           #offsetStr:Ljava/lang/String;
    .end local v3           #sharedPreferences:Landroid/content/SharedPreferences;
    :goto_0
    return-void

    .line 86
    :cond_0
    const/4 v4, 0x0

    iput-object v4, p0, Lcom/melesta/payment/amazon/PurchasingObserver;->mUserId:Ljava/lang/String;

    goto :goto_0
.end method

.method public onItemDataResponse(Lcom/amazon/inapp/purchasing/ItemDataResponse;)V
    .locals 3
    .parameter "itemDataResponse"

    .prologue
    .line 102
    const-string v0, "Amazon-IAP"

    const-string v1, "onItemDataResponse recieved"

    invoke-static {v0, v1}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 103
    const-string v0, "Amazon-IAP"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "ItemDataRequestStatus"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p1}, Lcom/amazon/inapp/purchasing/ItemDataResponse;->getItemDataRequestStatus()Lcom/amazon/inapp/purchasing/ItemDataResponse$ItemDataRequestStatus;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 104
    const-string v0, "Amazon-IAP"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "ItemDataRequestId"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p1}, Lcom/amazon/inapp/purchasing/ItemDataResponse;->getRequestId()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 106
    return-void
.end method

.method public onPurchaseResponse(Lcom/amazon/inapp/purchasing/PurchaseResponse;)V
    .locals 20
    .parameter "purchaseResponse"

    .prologue
    .line 119
    :try_start_0
    const-string v17, "Amazon-IAP"

    const-string v18, "onPurchaseResponse recieved"

    invoke-static/range {v17 .. v18}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 120
    const-string v17, "Amazon-IAP"

    new-instance v18, Ljava/lang/StringBuilder;

    invoke-direct/range {v18 .. v18}, Ljava/lang/StringBuilder;-><init>()V

    const-string v19, "PurchaseRequestStatus:"

    invoke-virtual/range {v18 .. v19}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v18

    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseResponse;->getPurchaseRequestStatus()Lcom/amazon/inapp/purchasing/PurchaseResponse$PurchaseRequestStatus;

    move-result-object v19

    invoke-virtual/range {v18 .. v19}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v18

    invoke-virtual/range {v18 .. v18}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v18

    invoke-static/range {v17 .. v18}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 122
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/melesta/payment/amazon/PurchasingObserver;->mUserId:Ljava/lang/String;

    move-object/from16 v16, v0

    .line 124
    .local v16, userId:Ljava/lang/String;
    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseResponse;->getUserId()Ljava/lang/String;

    move-result-object v8

    .line 125
    .local v8, purchaseUserId:Ljava/lang/String;
    move-object/from16 v0, v16

    invoke-virtual {v8, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v17

    if-nez v17, :cond_0

    .line 128
    move-object/from16 v0, p0

    iput-object v8, v0, Lcom/melesta/payment/amazon/PurchasingObserver;->mUserId:Ljava/lang/String;

    .line 129
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/melesta/payment/amazon/PurchasingObserver;->mContext:Landroid/content/Context;

    move-object/from16 v17, v0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/melesta/payment/amazon/PurchasingObserver;->mUserId:Ljava/lang/String;

    move-object/from16 v18, v0

    const/16 v19, 0x0

    invoke-virtual/range {v17 .. v19}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v13

    .line 130
    .local v13, sharedPreferences:Landroid/content/SharedPreferences;
    const-string v17, "offset"

    sget-object v18, Lcom/amazon/inapp/purchasing/Offset;->BEGINNING:Lcom/amazon/inapp/purchasing/Offset;

    invoke-virtual/range {v18 .. v18}, Lcom/amazon/inapp/purchasing/Offset;->toString()Ljava/lang/String;

    move-result-object v18

    move-object/from16 v0, v17

    move-object/from16 v1, v18

    invoke-interface {v13, v0, v1}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    .line 131
    .local v6, offsetStr:Ljava/lang/String;
    invoke-static {v6}, Lcom/amazon/inapp/purchasing/Offset;->fromString(Ljava/lang/String;)Lcom/amazon/inapp/purchasing/Offset;

    move-result-object v17

    invoke-static/range {v17 .. v17}, Lcom/amazon/inapp/purchasing/PurchasingManager;->initiatePurchaseUpdatesRequest(Lcom/amazon/inapp/purchasing/Offset;)Ljava/lang/String;

    .line 137
    .end local v6           #offsetStr:Ljava/lang/String;
    .end local v13           #sharedPreferences:Landroid/content/SharedPreferences;
    :cond_0
    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseResponse;->getRequestId()Ljava/lang/String;

    move-result-object v11

    .line 139
    .local v11, requestId:Ljava/lang/String;
    invoke-static {}, Lcom/melesta/payment/PaymentManager;->getInstance()Lcom/melesta/payment/PaymentManager;

    move-result-object v7

    .line 140
    .local v7, pm:Lcom/melesta/payment/PaymentManager;
    new-instance v17, Lcom/melesta/payment/amazon/RequestByIdFilter;

    invoke-direct/range {v17 .. v17}, Lcom/melesta/payment/amazon/RequestByIdFilter;-><init>()V

    move-object/from16 v0, v17

    invoke-virtual {v0, v11}, Lcom/melesta/payment/amazon/RequestByIdFilter;->setId(Ljava/lang/String;)Lcom/melesta/payment/amazon/RequestByIdFilter;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v7, v0}, Lcom/melesta/payment/PaymentManager;->getActiveRequest(Lcom/melesta/payment/interfaces/IRequestFilter;)Lcom/melesta/payment/interfaces/IRequest;

    move-result-object v10

    check-cast v10, Lcom/melesta/payment/amazon/Request;

    .line 141
    .local v10, request:Lcom/melesta/payment/amazon/Request;
    if-nez v10, :cond_1

    .line 225
    .end local v7           #pm:Lcom/melesta/payment/PaymentManager;
    .end local v8           #purchaseUserId:Ljava/lang/String;
    .end local v10           #request:Lcom/melesta/payment/amazon/Request;
    .end local v11           #requestId:Ljava/lang/String;
    .end local v16           #userId:Ljava/lang/String;
    :goto_0
    return-void

    .line 144
    .restart local v7       #pm:Lcom/melesta/payment/PaymentManager;
    .restart local v8       #purchaseUserId:Ljava/lang/String;
    .restart local v10       #request:Lcom/melesta/payment/amazon/Request;
    .restart local v11       #requestId:Ljava/lang/String;
    .restart local v16       #userId:Ljava/lang/String;
    :cond_1
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->getInstance()Lcom/melesta/engine/EngineActivity;

    move-result-object v17

    invoke-static/range {v17 .. v17}, Lcom/melesta/engine/DatabaseHelper;->getHelper(Landroid/content/Context;)Lcom/melesta/engine/DatabaseHelper;

    move-result-object v2

    .line 145
    .local v2, databaseHelper:Lcom/melesta/engine/DatabaseHelper;
    invoke-virtual {v2}, Lcom/melesta/engine/DatabaseHelper;->getTransactions()Ljava/util/List;

    move-result-object v17

    invoke-static/range {v17 .. v17}, Lcom/melesta/payment/PaymentTransaction;->dump(Ljava/util/List;)V

    .line 146
    new-instance v17, Lcom/melesta/payment/amazon/PurchasingObserver$1;

    move-object/from16 v0, v17

    move-object/from16 v1, p0

    invoke-direct {v0, v1, v11}, Lcom/melesta/payment/amazon/PurchasingObserver$1;-><init>(Lcom/melesta/payment/amazon/PurchasingObserver;Ljava/lang/String;)V

    move-object/from16 v0, v17

    invoke-virtual {v2, v0}, Lcom/melesta/engine/DatabaseHelper;->getTransactions(Lcom/melesta/engine/DatabaseHelper$IObjectFilter;)Ljava/util/List;

    move-result-object v15

    .line 158
    .local v15, transactions:Ljava/util/List;,"Ljava/util/List<Lcom/melesta/payment/PaymentTransaction;>;"
    invoke-interface {v15}, Ljava/util/List;->size()I

    move-result v17

    const/16 v18, 0x1

    move/from16 v0, v17

    move/from16 v1, v18

    if-le v0, v1, :cond_2

    .line 159
    const-string v17, "Amazon-IAP"

    const-string v18, "transactions != 1"

    invoke-static/range {v17 .. v18}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 162
    :cond_2
    const/16 v17, 0x0

    move/from16 v0, v17

    invoke-interface {v15, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v14

    check-cast v14, Lcom/melesta/payment/PaymentTransaction;

    .line 164
    .local v14, tr:Lcom/melesta/payment/PaymentTransaction;
    new-instance v12, Lcom/melesta/payment/amazon/Response;

    invoke-direct {v12}, Lcom/melesta/payment/amazon/Response;-><init>()V

    .line 165
    .local v12, response:Lcom/melesta/payment/amazon/Response;
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/melesta/payment/amazon/PurchasingObserver;->mPaymentSystem:Lcom/melesta/payment/amazon/PaymentSystem;

    move-object/from16 v17, v0

    invoke-virtual/range {v17 .. v17}, Lcom/melesta/payment/amazon/PaymentSystem;->getDefaultListener()Lcom/melesta/payment/interfaces/IListener;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v12, v0}, Lcom/melesta/payment/amazon/Response;->setListener(Lcom/melesta/payment/interfaces/IListener;)Lcom/melesta/payment/interfaces/IResponse;

    .line 166
    invoke-virtual {v10}, Lcom/melesta/payment/amazon/Request;->getSku()Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v12, v0}, Lcom/melesta/payment/amazon/Response;->setSku(Ljava/lang/String;)Lcom/melesta/payment/amazon/Response;

    .line 167
    invoke-virtual {v10}, Lcom/melesta/payment/amazon/Request;->getName()Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v12, v0}, Lcom/melesta/payment/amazon/Response;->setName(Ljava/lang/String;)Lcom/melesta/payment/amazon/Response;

    .line 169
    sget-object v17, Lcom/melesta/payment/amazon/PurchasingObserver$3;->$SwitchMap$com$amazon$inapp$purchasing$PurchaseResponse$PurchaseRequestStatus:[I

    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseResponse;->getPurchaseRequestStatus()Lcom/amazon/inapp/purchasing/PurchaseResponse$PurchaseRequestStatus;

    move-result-object v18

    invoke-virtual/range {v18 .. v18}, Lcom/amazon/inapp/purchasing/PurchaseResponse$PurchaseRequestStatus;->ordinal()I

    move-result v18

    aget v17, v17, v18

    packed-switch v17, :pswitch_data_0

    .line 220
    :goto_1
    invoke-virtual {v7, v12}, Lcom/melesta/payment/PaymentManager;->postResponse(Lcom/melesta/payment/interfaces/IResponse;)V

    .line 221
    invoke-virtual {v7, v10}, Lcom/melesta/payment/PaymentManager;->removeActiveRequest(Lcom/melesta/payment/interfaces/IRequest;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 222
    .end local v2           #databaseHelper:Lcom/melesta/engine/DatabaseHelper;
    .end local v7           #pm:Lcom/melesta/payment/PaymentManager;
    .end local v8           #purchaseUserId:Ljava/lang/String;
    .end local v10           #request:Lcom/melesta/payment/amazon/Request;
    .end local v11           #requestId:Ljava/lang/String;
    .end local v12           #response:Lcom/melesta/payment/amazon/Response;
    .end local v14           #tr:Lcom/melesta/payment/PaymentTransaction;
    .end local v15           #transactions:Ljava/util/List;,"Ljava/util/List<Lcom/melesta/payment/PaymentTransaction;>;"
    .end local v16           #userId:Ljava/lang/String;
    :catch_0
    move-exception v3

    .line 223
    .local v3, e:Ljava/lang/Exception;
    const-string v17, "amazon-onPurchaseResponse"

    move-object/from16 v0, v17

    invoke-static {v0, v3}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0

    .line 176
    .end local v3           #e:Ljava/lang/Exception;
    .restart local v2       #databaseHelper:Lcom/melesta/engine/DatabaseHelper;
    .restart local v7       #pm:Lcom/melesta/payment/PaymentManager;
    .restart local v8       #purchaseUserId:Ljava/lang/String;
    .restart local v10       #request:Lcom/melesta/payment/amazon/Request;
    .restart local v11       #requestId:Ljava/lang/String;
    .restart local v12       #response:Lcom/melesta/payment/amazon/Response;
    .restart local v14       #tr:Lcom/melesta/payment/PaymentTransaction;
    .restart local v15       #transactions:Ljava/util/List;,"Ljava/util/List<Lcom/melesta/payment/PaymentTransaction;>;"
    .restart local v16       #userId:Ljava/lang/String;
    :pswitch_0
    :try_start_1
    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseResponse;->getReceipt()Lcom/amazon/inapp/purchasing/Receipt;

    move-result-object v9

    .line 177
    .local v9, receipt:Lcom/amazon/inapp/purchasing/Receipt;
    if-eqz v9, :cond_3

    .line 178
    sget-object v17, Lcom/melesta/payment/amazon/PurchasingObserver$3;->$SwitchMap$com$amazon$inapp$purchasing$Item$ItemType:[I

    invoke-virtual {v9}, Lcom/amazon/inapp/purchasing/Receipt;->getItemType()Lcom/amazon/inapp/purchasing/Item$ItemType;

    move-result-object v18

    invoke-virtual/range {v18 .. v18}, Lcom/amazon/inapp/purchasing/Item$ItemType;->ordinal()I

    move-result v18

    aget v17, v17, v18

    packed-switch v17, :pswitch_data_1

    .line 187
    :cond_3
    :pswitch_1
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v17

    move-wide/from16 v0, v17

    iput-wide v0, v14, Lcom/melesta/payment/PaymentTransaction;->time:J

    .line 189
    invoke-virtual {v2, v14}, Lcom/melesta/engine/DatabaseHelper;->saveTransaction(Lcom/melesta/payment/PaymentTransaction;)J

    move-result-wide v4

    .line 191
    .local v4, id:J
    invoke-virtual {v12, v4, v5}, Lcom/melesta/payment/amazon/Response;->setInternalId(J)V

    .line 192
    invoke-virtual {v9}, Lcom/amazon/inapp/purchasing/Receipt;->getSku()Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v12, v0}, Lcom/melesta/payment/amazon/Response;->setSku(Ljava/lang/String;)Lcom/melesta/payment/amazon/Response;

    .line 193
    sget-object v17, Lcom/melesta/payment/amazon/Response$Status;->PURCHASE:Lcom/melesta/payment/amazon/Response$Status;

    move-object/from16 v0, v17

    invoke-virtual {v12, v0}, Lcom/melesta/payment/amazon/Response;->setStatus(Lcom/melesta/payment/amazon/Response$Status;)Lcom/melesta/payment/amazon/Response;

    goto :goto_1

    .line 183
    .end local v4           #id:J
    :pswitch_2
    new-instance v17, Ljava/lang/Exception;

    const-string v18, "Amazon Subscriptions is not supported!"

    invoke-direct/range {v17 .. v18}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V

    throw v17

    .line 201
    .end local v9           #receipt:Lcom/amazon/inapp/purchasing/Receipt;
    :pswitch_3
    const-string v17, "Amazon-IAP"

    new-instance v18, Ljava/lang/StringBuilder;

    invoke-direct/range {v18 .. v18}, Ljava/lang/StringBuilder;-><init>()V

    const-string v19, "Failed purchase for request"

    invoke-virtual/range {v18 .. v19}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v18

    move-object/from16 v0, v18

    invoke-virtual {v0, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v18

    invoke-virtual/range {v18 .. v18}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v18

    invoke-static/range {v17 .. v18}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 202
    iget-wide v0, v14, Lcom/melesta/payment/PaymentTransaction;->internalId:J

    move-wide/from16 v17, v0

    move-wide/from16 v0, v17

    invoke-virtual {v2, v0, v1}, Lcom/melesta/engine/DatabaseHelper;->deleteTransaction(J)Z

    .line 203
    sget-object v17, Lcom/amazon/inapp/purchasing/PurchaseResponse$PurchaseRequestStatus;->FAILED:Lcom/amazon/inapp/purchasing/PurchaseResponse$PurchaseRequestStatus;

    invoke-virtual/range {v17 .. v17}, Lcom/amazon/inapp/purchasing/PurchaseResponse$PurchaseRequestStatus;->ordinal()I

    move-result v17

    move/from16 v0, v17

    invoke-virtual {v12, v0}, Lcom/melesta/payment/amazon/Response;->setErrorCode(I)Lcom/melesta/payment/amazon/Response;

    .line 204
    sget-object v17, Lcom/melesta/payment/amazon/Response$Status;->ERROR:Lcom/melesta/payment/amazon/Response$Status;

    move-object/from16 v0, v17

    invoke-virtual {v12, v0}, Lcom/melesta/payment/amazon/Response;->setStatus(Lcom/melesta/payment/amazon/Response$Status;)Lcom/melesta/payment/amazon/Response;

    goto/16 :goto_1

    .line 213
    :pswitch_4
    const-string v17, "Amazon-IAP"

    new-instance v18, Ljava/lang/StringBuilder;

    invoke-direct/range {v18 .. v18}, Ljava/lang/StringBuilder;-><init>()V

    const-string v19, "Invalid Sku for request "

    invoke-virtual/range {v18 .. v19}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v18

    move-object/from16 v0, v18

    invoke-virtual {v0, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v18

    invoke-virtual/range {v18 .. v18}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v18

    invoke-static/range {v17 .. v18}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 214
    iget-wide v0, v14, Lcom/melesta/payment/PaymentTransaction;->internalId:J

    move-wide/from16 v17, v0

    move-wide/from16 v0, v17

    invoke-virtual {v2, v0, v1}, Lcom/melesta/engine/DatabaseHelper;->deleteTransaction(J)Z

    .line 215
    sget-object v17, Lcom/amazon/inapp/purchasing/PurchaseResponse$PurchaseRequestStatus;->INVALID_SKU:Lcom/amazon/inapp/purchasing/PurchaseResponse$PurchaseRequestStatus;

    invoke-virtual/range {v17 .. v17}, Lcom/amazon/inapp/purchasing/PurchaseResponse$PurchaseRequestStatus;->ordinal()I

    move-result v17

    move/from16 v0, v17

    invoke-virtual {v12, v0}, Lcom/melesta/payment/amazon/Response;->setErrorCode(I)Lcom/melesta/payment/amazon/Response;

    .line 216
    sget-object v17, Lcom/melesta/payment/amazon/Response$Status;->ERROR:Lcom/melesta/payment/amazon/Response$Status;

    move-object/from16 v0, v17

    invoke-virtual {v12, v0}, Lcom/melesta/payment/amazon/Response;->setStatus(Lcom/melesta/payment/amazon/Response$Status;)Lcom/melesta/payment/amazon/Response;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto/16 :goto_1

    .line 169
    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_0
        :pswitch_3
        :pswitch_4
    .end packed-switch

    .line 178
    :pswitch_data_1
    .packed-switch 0x1
        :pswitch_1
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method

.method public onPurchaseUpdatesResponse(Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse;)V
    .locals 19
    .parameter "purchaseUpdatesResponse"

    .prologue
    .line 239
    :try_start_0
    const-string v16, "Amazon-IAP"

    new-instance v17, Ljava/lang/StringBuilder;

    invoke-direct/range {v17 .. v17}, Ljava/lang/StringBuilder;-><init>()V

    const-string v18, "onPurchaseUpdatesRecived recieved: Response -"

    invoke-virtual/range {v17 .. v18}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v17

    move-object/from16 v0, v17

    move-object/from16 v1, p1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v17

    invoke-virtual/range {v17 .. v17}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v17

    invoke-static/range {v16 .. v17}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 240
    const-string v16, "Amazon-IAP"

    new-instance v17, Ljava/lang/StringBuilder;

    invoke-direct/range {v17 .. v17}, Ljava/lang/StringBuilder;-><init>()V

    const-string v18, "PurchaseUpdatesRequestStatus:"

    invoke-virtual/range {v17 .. v18}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v17

    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse;->getPurchaseUpdatesRequestStatus()Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse$PurchaseUpdatesRequestStatus;

    move-result-object v18

    invoke-virtual/range {v17 .. v18}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v17

    invoke-virtual/range {v17 .. v17}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v17

    invoke-static/range {v16 .. v17}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 241
    const-string v16, "Amazon-IAP"

    new-instance v17, Ljava/lang/StringBuilder;

    invoke-direct/range {v17 .. v17}, Ljava/lang/StringBuilder;-><init>()V

    const-string v18, "RequestID:"

    invoke-virtual/range {v17 .. v18}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v17

    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse;->getRequestId()Ljava/lang/String;

    move-result-object v18

    invoke-virtual/range {v17 .. v18}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v17

    invoke-virtual/range {v17 .. v17}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v17

    invoke-static/range {v16 .. v17}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 243
    invoke-direct/range {p0 .. p0}, Lcom/melesta/payment/amazon/PurchasingObserver;->getSharedPreferencesEditor()Landroid/content/SharedPreferences$Editor;

    move-result-object v5

    .line 244
    .local v5, editor:Landroid/content/SharedPreferences$Editor;
    move-object/from16 v0, p0

    iget-object v15, v0, Lcom/melesta/payment/amazon/PurchasingObserver;->mUserId:Ljava/lang/String;

    .line 245
    .local v15, userId:Ljava/lang/String;
    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse;->getUserId()Ljava/lang/String;

    move-result-object v16

    move-object/from16 v0, v16

    invoke-virtual {v0, v15}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v16

    if-nez v16, :cond_1

    .line 383
    .end local v5           #editor:Landroid/content/SharedPreferences$Editor;
    .end local v15           #userId:Ljava/lang/String;
    :cond_0
    :goto_0
    return-void

    .line 249
    .restart local v5       #editor:Landroid/content/SharedPreferences$Editor;
    .restart local v15       #userId:Ljava/lang/String;
    :cond_1
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/melesta/payment/amazon/PurchasingObserver;->mContext:Landroid/content/Context;

    move-object/from16 v16, v0

    invoke-static/range {v16 .. v16}, Lcom/melesta/engine/DatabaseHelper;->getHelper(Landroid/content/Context;)Lcom/melesta/engine/DatabaseHelper;

    move-result-object v2

    .line 250
    .local v2, databaseHelper:Lcom/melesta/engine/DatabaseHelper;
    const-string v12, "amazon"

    .line 253
    .local v12, systemName:Ljava/lang/String;
    new-instance v16, Lcom/melesta/payment/amazon/PurchasingObserver$2;

    move-object/from16 v0, v16

    move-object/from16 v1, p0

    invoke-direct {v0, v1}, Lcom/melesta/payment/amazon/PurchasingObserver$2;-><init>(Lcom/melesta/payment/amazon/PurchasingObserver;)V

    move-object/from16 v0, v16

    invoke-virtual {v2, v0}, Lcom/melesta/engine/DatabaseHelper;->getTransactions(Lcom/melesta/engine/DatabaseHelper$IObjectFilter;)Ljava/util/List;

    move-result-object v3

    .line 265
    .local v3, dbTransactions:Ljava/util/List;,"Ljava/util/List<Lcom/melesta/payment/PaymentTransaction;>;"
    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse;->getRevokedSkus()Ljava/util/Set;

    move-result-object v16

    invoke-interface/range {v16 .. v16}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v6

    .local v6, i$:Ljava/util/Iterator;
    invoke-interface {v6}, Ljava/util/Iterator;->hasNext()Z

    move-result v16

    if-eqz v16, :cond_2

    invoke-interface {v6}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v11

    check-cast v11, Ljava/lang/String;

    .line 266
    .local v11, sku:Ljava/lang/String;
    const-string v16, "Amazon-IAP"

    new-instance v17, Ljava/lang/StringBuilder;

    invoke-direct/range {v17 .. v17}, Ljava/lang/StringBuilder;-><init>()V

    const-string v18, "Revoked Sku:"

    invoke-virtual/range {v17 .. v18}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v0, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v17

    invoke-virtual/range {v17 .. v17}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v17

    invoke-static/range {v16 .. v17}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 267
    new-instance v16, Ljava/lang/Exception;

    const-string v17, "Amaozn revoke is not supported"

    invoke-direct/range {v16 .. v17}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V

    throw v16
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 380
    .end local v2           #databaseHelper:Lcom/melesta/engine/DatabaseHelper;
    .end local v3           #dbTransactions:Ljava/util/List;,"Ljava/util/List<Lcom/melesta/payment/PaymentTransaction;>;"
    .end local v5           #editor:Landroid/content/SharedPreferences$Editor;
    .end local v6           #i$:Ljava/util/Iterator;
    .end local v11           #sku:Ljava/lang/String;
    .end local v12           #systemName:Ljava/lang/String;
    .end local v15           #userId:Ljava/lang/String;
    :catch_0
    move-exception v4

    .line 381
    .local v4, e:Ljava/lang/Exception;
    const-string v16, "Amazon-IAP"

    move-object/from16 v0, v16

    invoke-static {v0, v4}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0

    .line 270
    .end local v4           #e:Ljava/lang/Exception;
    .restart local v2       #databaseHelper:Lcom/melesta/engine/DatabaseHelper;
    .restart local v3       #dbTransactions:Ljava/util/List;,"Ljava/util/List<Lcom/melesta/payment/PaymentTransaction;>;"
    .restart local v5       #editor:Landroid/content/SharedPreferences$Editor;
    .restart local v6       #i$:Ljava/util/Iterator;
    .restart local v12       #systemName:Ljava/lang/String;
    .restart local v15       #userId:Ljava/lang/String;
    :cond_2
    :try_start_1
    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse;->getPurchaseUpdatesRequestStatus()Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse$PurchaseUpdatesRequestStatus;

    move-result-object v16

    sget-object v17, Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse$PurchaseUpdatesRequestStatus;->FAILED:Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse$PurchaseUpdatesRequestStatus;

    move-object/from16 v0, v16

    move-object/from16 v1, v17

    if-eq v0, v1, :cond_0

    .line 280
    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse;->getReceipts()Ljava/util/Set;

    move-result-object v16

    invoke-interface/range {v16 .. v16}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v6

    .end local v6           #i$:Ljava/util/Iterator;
    :cond_3
    :goto_1
    invoke-interface {v6}, Ljava/util/Iterator;->hasNext()Z

    move-result v16

    if-eqz v16, :cond_6

    invoke-interface {v6}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Lcom/amazon/inapp/purchasing/Receipt;

    .line 281
    .local v10, receipt:Lcom/amazon/inapp/purchasing/Receipt;
    invoke-virtual {v10}, Lcom/amazon/inapp/purchasing/Receipt;->getSku()Ljava/lang/String;

    move-result-object v11

    .line 283
    .restart local v11       #sku:Ljava/lang/String;
    invoke-virtual {v10}, Lcom/amazon/inapp/purchasing/Receipt;->getItemType()Lcom/amazon/inapp/purchasing/Item$ItemType;

    move-result-object v16

    sget-object v17, Lcom/amazon/inapp/purchasing/Item$ItemType;->ENTITLED:Lcom/amazon/inapp/purchasing/Item$ItemType;

    move-object/from16 v0, v16

    move-object/from16 v1, v17

    if-ne v0, v1, :cond_3

    .line 285
    const/4 v13, 0x0

    .line 286
    .local v13, t:Lcom/melesta/payment/PaymentTransaction;
    invoke-interface {v3}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v7

    .local v7, i$:Ljava/util/Iterator;
    :cond_4
    invoke-interface {v7}, Ljava/util/Iterator;->hasNext()Z

    move-result v16

    if-eqz v16, :cond_5

    invoke-interface {v7}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v14

    check-cast v14, Lcom/melesta/payment/PaymentTransaction;

    .line 287
    .local v14, tr:Lcom/melesta/payment/PaymentTransaction;
    const-string v16, "amazon"

    iget-object v0, v14, Lcom/melesta/payment/PaymentTransaction;->paymentSystem:Ljava/lang/String;

    move-object/from16 v17, v0

    invoke-virtual/range {v16 .. v17}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v16

    if-eqz v16, :cond_4

    iget-object v0, v14, Lcom/melesta/payment/PaymentTransaction;->paymentId:Ljava/lang/String;

    move-object/from16 v16, v0

    move-object/from16 v0, v16

    invoke-virtual {v0, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v16

    if-eqz v16, :cond_4

    .line 288
    move-object v13, v14

    .line 293
    .end local v14           #tr:Lcom/melesta/payment/PaymentTransaction;
    :cond_5
    if-nez v13, :cond_3

    .line 297
    invoke-static {}, Lcom/melesta/payment/PaymentManager;->getInstance()Lcom/melesta/payment/PaymentManager;

    move-result-object v9

    .line 298
    .local v9, pm:Lcom/melesta/payment/PaymentManager;
    new-instance v13, Lcom/melesta/payment/PaymentTransaction;

    .end local v13           #t:Lcom/melesta/payment/PaymentTransaction;
    invoke-direct {v13}, Lcom/melesta/payment/PaymentTransaction;-><init>()V

    .line 299
    .restart local v13       #t:Lcom/melesta/payment/PaymentTransaction;
    const-string v16, "amazon"

    move-object/from16 v0, v16

    invoke-virtual {v9, v0, v11}, Lcom/melesta/payment/PaymentManager;->getRequestNameBySku(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    move-object/from16 v0, v16

    iput-object v0, v13, Lcom/melesta/payment/PaymentTransaction;->paymentId:Ljava/lang/String;

    .line 300
    const-string v16, "amazon"

    move-object/from16 v0, v16

    iput-object v0, v13, Lcom/melesta/payment/PaymentTransaction;->paymentSystem:Ljava/lang/String;

    .line 301
    const/16 v16, 0x1

    move/from16 v0, v16

    iput v0, v13, Lcom/melesta/payment/PaymentTransaction;->quantity:I

    .line 302
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v16

    move-wide/from16 v0, v16

    iput-wide v0, v13, Lcom/melesta/payment/PaymentTransaction;->time:J

    .line 303
    invoke-virtual {v10}, Lcom/amazon/inapp/purchasing/Receipt;->getPurchaseToken()Ljava/lang/String;

    move-result-object v16

    move-object/from16 v0, v16

    iput-object v0, v13, Lcom/melesta/payment/PaymentTransaction;->customData:Ljava/lang/String;

    .line 306
    invoke-virtual {v2, v13}, Lcom/melesta/engine/DatabaseHelper;->saveTransaction(Lcom/melesta/payment/PaymentTransaction;)J

    goto :goto_1

    .line 373
    .end local v7           #i$:Ljava/util/Iterator;
    .end local v9           #pm:Lcom/melesta/payment/PaymentManager;
    .end local v10           #receipt:Lcom/amazon/inapp/purchasing/Receipt;
    .end local v11           #sku:Ljava/lang/String;
    .end local v13           #t:Lcom/melesta/payment/PaymentTransaction;
    :cond_6
    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse;->getOffset()Lcom/amazon/inapp/purchasing/Offset;

    move-result-object v8

    .line 374
    .local v8, newOffset:Lcom/amazon/inapp/purchasing/Offset;
    const-string v16, "offset"

    invoke-virtual {v8}, Lcom/amazon/inapp/purchasing/Offset;->toString()Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v16

    move-object/from16 v1, v17

    invoke-interface {v5, v0, v1}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 375
    invoke-interface {v5}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 376
    invoke-virtual/range {p1 .. p1}, Lcom/amazon/inapp/purchasing/PurchaseUpdatesResponse;->isMore()Z

    move-result v16

    if-eqz v16, :cond_0

    .line 377
    const-string v16, "Amazon-IAP"

    new-instance v17, Ljava/lang/StringBuilder;

    invoke-direct/range {v17 .. v17}, Ljava/lang/StringBuilder;-><init>()V

    const-string v18, "Initiating Another Purchase Updates with offset: "

    invoke-virtual/range {v17 .. v18}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v17

    invoke-virtual {v8}, Lcom/amazon/inapp/purchasing/Offset;->toString()Ljava/lang/String;

    move-result-object v18

    invoke-virtual/range {v17 .. v18}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v17

    invoke-virtual/range {v17 .. v17}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v17

    invoke-static/range {v16 .. v17}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 378
    invoke-static {v8}, Lcom/amazon/inapp/purchasing/PurchasingManager;->initiatePurchaseUpdatesRequest(Lcom/amazon/inapp/purchasing/Offset;)Ljava/lang/String;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto/16 :goto_0
.end method

.method public onSdkAvailable(Z)V
    .locals 4
    .parameter "isSandboxMode"

    .prologue
    .line 57
    invoke-static {}, Lcom/amazon/inapp/purchasing/PurchasingManager;->initiateGetUserIdRequest()Ljava/lang/String;

    move-result-object v0

    .line 58
    .local v0, id:Ljava/lang/String;
    const-string v1, "Amazon-IAP"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "onSdkAvailable recieved: Response -"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, " :"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/melesta/engine/Log;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 59
    return-void
.end method
